<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="commun.xsl"/>
	<xsl:import href="template_name.xsl"/>
	
	<xsl:variable name="CONTEXTE">
		<xsl:choose>
			<xsl:when test="/root/data/Operation/operationId">update</xsl:when>
			<xsl:otherwise>create</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>
	<!-- template js -->
	<xsl:template name="js.module.sheet">
		<script language="JavaScript" src="application/js/operationEdition.js" type="text/javascript"/>
		<script language="JavaScript" src="application/js/jquery_opertation_edition.js" type="text/javascript"/>
		<script language="JavaScript" src="application/js/ajax_application.js" type="text/javascript"/>
	</xsl:template>
	<!-- template principal -->
	<xsl:template name="Contenu">
		<br/>
		<a href="index.php?page=OPERATIONS_L&amp;numeroCompte={$NUMEROCOMPTE}">
			<xsl:value-of select="$LBL.RETOURALALISTE"/>
		</a>
		<center>
			<br/>
			<br/>
			<xsl:if test="1=0">
				<xsl:attribute name="onload">document.location.href='index.php&amp;page=OPERATIONS_L&amp;numeroCompte=<xsl:value-of select="$NUMEROCOMPTE"/>';</xsl:attribute>
			</xsl:if>
			<xsl:call-template name="Operation"/>
		</center>
	</xsl:template>
	<xsl:template name="Operation">
		<form method="POST" action="#" onsubmit="return soumettre(this);" name="operation" id="operation">
			<input type="hidden" name="mode" id="mode">
				<xsl:attribute name="value">
					<xsl:value-of select="$CONTEXTE"/>
				</xsl:attribute>
			</input>
			<input type="hidden" id="noCompte" name="noCompte" value="{$NUMEROCOMPTE}"/>
			<input type="hidden" name="operationId" id="operationId" value="{/root/data/Operation/operationId}"/>
			<table class="formulaire">
				<tbody>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.NUMERORELEVE"/>
						</th>
						<td style="width: 445px;">
							<input size="12" name="noReleve" id="noReleve"  tabindex="10" value="{/root/data/Operation/noReleve}"/>
						</td>
					</tr>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.DATE"/>
						</th>
						<td style="width: 445px;">
							<input type="text" name="date" id="date" size="10"  tabindex="20" value="{/root/data/Operation/date}"/>
							<input type="button" value=" * " onclick="displayCalendar(document.getElementById('date'),'yyyy-mm-dd',this)"/>
						</td>
					</tr>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.LIBELLE"/>
						</th>
						<td style="width: 445px;">
							<input size="60" name="libelle"  tabindex="30" value="{/root/data/Operation/libelle}"/>
						</td>
					</tr>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.FLUX"/>
						</th>
						<td style="width: 445px;">
							<xsl:call-template name="ListeFlux">
								<xsl:with-param name="liste" select="/root/data/ListeFlux"/>
								<xsl:with-param name="champ" select="'fluxId'"/>
								<xsl:with-param name="valeur" select="/root/data/Operation/fluxId"/>
								<xsl:with-param name="class" select="'obligatoire'"/>
								<xsl:with-param name="tabindex" select="'40'"/>
								<xsl:with-param name="onchange" select="'getModeReglementDefaut(this, this.form.modePaiementId)'"/>
							</xsl:call-template>
						</td>
					</tr>
					<tr>
						<th>
							<xsl:value-of select="$LBL.MODEDEPAIEMENT"/>
						</th>
						<td>
							<xsl:call-template name="ModifSelect">
								<xsl:with-param name="value" select="/root/data/Operation/modePaiementId"/>
								<xsl:with-param name="Node" select="/root/paramFlow/MODPAI"/>
								<xsl:with-param name="nom" select="'modePaiementId'"/>
								<xsl:with-param name="defaultValue" select="''"/>
								<xsl:with-param name="defaultDisplay" select="''"/>
								<xsl:with-param name="optionVide" select="'O'"/>
								<xsl:with-param name="tabindex" select="'50'"/>
							</xsl:call-template>
						</td>
					</tr>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.MONTANT"/>
						</th>
						<td style="width: 445px;">
							<input size="7" name="montant" id="montant" class="numerique_obligatoire" onblur="return isDouble(this);" tabindex="60">
								<xsl:attribute name="value">
									<xsl:choose>
										<xsl:when test="/root/data/Operation/montant">
											<xsl:call-template name="Montant">
												<xsl:with-param name="montant" select="/root/data/Operation/montant"/>
											</xsl:call-template>
										</xsl:when>
										<xsl:otherwise>0</xsl:otherwise>
									</xsl:choose>
								</xsl:attribute>
							</input>
						</td>
					</tr>
					<tr>
						<th style="width: 266px;">
							<xsl:value-of select="$LBL.VERIFICATION"/>
						</th>
						<td style="width: 445px;">
							<input type="checkbox" name="verif" id="verif" checked="Verif" tabindex="70" />
						</td>
					</tr>
					<tr align="center">
						<td colspan="2" rowspan="1">
							<input name="valider" value="Valider" type="submit"/>
							<!--<input name="valider" value="Valider" type="submit"/>-->
						</td>
					</tr>
					<!--<tr>
						<td style="width: 266px;"/>
						<td style="width: 445px;"/>
					</tr>
					<tr>
						<td style="width: 266px;"/>
						<td style="width: 445px;"/>
					</tr>-->
				</tbody>
			</table>
		</form>
	</xsl:template>
</xsl:stylesheet>
